<template>
	<view>
		<view class="info-content-item">
			姓名<view>{{employeeInfo.cempName}}</view>
		</view>
		<view class="info-button">
			<button type="primary" plain="true" @click="editPasswd">修改密码</button>
			<button type="primary" plain="true" @click="logout">退出登陆</button>
		</view>
	</view>
</template>

<script>
	import api from "@/common/api.js"
	export default {
		data() {
			return {
				employeeInfo: {}
			}
		},
		onReady() {
			this.employeeInfo = api.getUserInfo();
			console.log(this.employeeInfo)
		},
		methods: {
			// 修改密码
			editPasswd() {
				uni.navigateTo({
					url: '/pages/myInfo/editPasswd',
				})
			},
			// 退出登录
			logout() {
				uni.clearStorage();
				setTimeout(function() {
					uni.redirectTo({
						url: "../login/login",
					})
				}, 500);
			},

		}
	}
</script>

<style>
	/*内容区域样式*/
	.info-content-item {
		display: flex;
		height: 50px;
		line-height: 50px;
		padding: 0 80px 0 30px;
		justify-content: space-between;
		margin: 10px 20px;
		border: 1px solid #eaeaea;
		border-radius: 5px;
	}

	.info-content-item view {
		color: #8F8F94;
	}

	.info-button {
		padding: 20px 0px;
	}

	.info-button button {
		width: 80%;
		border-radius: 150rpx;
		margin-bottom: 20px;
	}
</style>
